<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增跑马灯')" />
	<th:block th:include="include :: select2-css" />
    <!--<th:block th:include="include :: summernote-css"/>-->
</head>
<body>
    <div class="form-content">
        <form id="form-pmd-add" class="form-horizontal">
            <input name="deptId" type="hidden" id="treeId"/>
            <h4 class="form-header h4">基本信息</h4>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>速度：</label>
                        <div class="col-sm-8">
                            <input name="speed" id="speed" autocomplete="off" placeholder="速度" class="form-control" type="text" >
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>内容：</label>
                        <div class="col-sm-8">
                            <textarea name="content" id="content" class="form-control"></textarea>
                        </div>
                        <!--<label class="col-sm-4 control-label"><span style="color: red; ">*</span>内容：</label>
                        <div class="col-sm-8">
                            <input name="content" autocomplete="off" placeholder="请输入内容" class="form-control" type="text">
                        </div>-->
                    </div>
                </div>
            </div>

            <!--<div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>创建人：</label>
                        <div class="col-sm-8">
                            <input name="createBy" autocomplete="off" placeholder="请输入创建人" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>修改人：</label>
                        <div class="col-sm-8">
                            <input name="updateBy" autocomplete="off" class="form-control" type="text"  placeholder="请输入修改人">
                        </div>
                    </div>
                </div>
            </div>-->

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label"><span style="color: red; ">*</span>备注：</label>
                        <div class="col-sm-8">
                            <input name="remark" id="remark" autocomplete="off" placeholder="请输备注" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>

        </form>
    </div>
    <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
        </div>
    </div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: select2-js" />
    <script type="text/javascript" src="../../ajax/libs/ckeditor/ckeditor.js"></script>
	<script>
        CKEDITOR.replace('content');

        function submitHandler() {
	        if ($.validate.form()) {
                var speed = $("#speed").val();
                var remark = $("#remark").val();
                var content = CKEDITOR.instances.content.getData()
                var addUrl = 'http://58.40.12.162:18080/biz/pmd/addSave';
	        	var data = speed +"$$" + remark + "$$" + content;
                $.ajax({
                    type:'POST',
                    data:data,
                    contentType :'application/json;charset=utf-8',
                    dataType:'text',
                    url :addUrl,
                    success: function(result) {
                        result = JSON.parse(result);
                        $.operate.successTabCallback(result);
                    },
                    error :function(e) {
                    }

                });
	        }
	    }
    </script>
</body>
</html>
